<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Settings extends AdminController{
	public $_validation = null;

	function __construct(){
		parent::__construct();
	}

	function index(){
        $obj = $this->_siteConf;
		$this->assign('obj', $obj);
		$this->layout('form.tpl');
	}

	function edit_post(){
	    $data = $this->input->post();
	    if ($this->db->update('site_config',$data,['id' => 1])){
	        successAndRedirect('更新成功',site_url('/settings/settings/index'));
        }else{
	        errorAndRedirect('更新失败',site_url('/settings/settings/index'));
        }
	    $this->assign('obj', $this->_siteConf);
	    $this->layout('form.tpl');
	}
}
